package com.foreknow.eldclient.service.impl;

import com.foreknow.eldclient.dao.CartMapper;
import com.foreknow.eldclient.po.Cart;
import com.foreknow.eldclient.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl implements CartService {
    @Autowired
    private CartMapper cM;


    @Override
    public int saveCart(Cart cart) {
        return cM.saveCart(cart);
    }

    @Override
    public int updateCart(Cart cart) throws Exception {
            return cM.updateCart(cart);
    }

    @Override
    public int removeCart(Cart cart) throws Exception {
            return cM.removeCart(cart);
    }

    @Override
    public List<Cart> listCart(Cart cart) throws Exception {
        List<Cart> carts = cM.listCart(cart);
        return carts;
    }

}
